{% extends 'layout.html' %}
{% load permission %}
{% load color %}

{% block css %}
    <link rel="stylesheet" href="/static/css/search-group.css">
{% endblock %}
{% block content %}

    {% include 'include/search_group.html' %}

    <div class="clearfix">
        <div class="col-lg-3" style="float:right;">
            <form action="" method="get">
                <div class="input-group">
                    <input name="keyword" type="text" class="form-control" placeholder="请输入订单号查询"
                           value="{{ keyword }}">
                    <span class="input-group-btn">
                    <button class="btn btn-default glyphicon glyphicon-search" type="submit"></button>
                </span>
                </div><!-- /input-group -->
            </form>
        </div><!-- /.col-lg-6 -->
    </div>

    <hr>
    <div style="padding: 0 20px 0 20px">
        <table class="table table-bordered table-striped table-hover">
            <thead>
            <tr class="text-center">
                <td>id</td>
                <td>charge_type</td>
                <td>amount</td>
                <td>order_oid</td>
                <td>create_datetime</td>
                <td>memo</td>
            </tr>
            </thead>
            <tbody>
            {% for foo in show_data %}
                <tr class="text-center ">
                    <td>{{ forloop.counter }}</td>
                    <td>
                        <span class="btn btn-{{ foo.charge_type|color }}">{{ foo.get_charge_type_display }}</span>
                    </td>
                    <td>
                        {% if foo.charge_type == 2 or foo.charge_type == 3 %}
                            -{{ foo.amount }}
                        {% else %}
                            +{{ foo.amount }}
                        {% endif %}
                    </td>
                    {% if foo.order_oid %}
                        <td>{{ foo.order_oid }}</td>
                    {% else %}
                        <td>-</td>
                    {% endif %}
                    <td>{{ foo.create_datetime|date:"Y-m-d H:i:s" }}</td>
                    {% if foo.memo %}
                        <td>{{ foo.memo }}</td>
                    {% else %}
                        <td>-</td>
                    {% endif %}
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    <h3 class="h3 text-center text-info">{{ errors }}</h3>

    <ul class="pagination">
        {{ pager_string }}
    </ul>

{% endblock %}

{% block js %}
{% endblock %}